<template>
<div>
    <div v-for="(item,index) in data.category" :key="index">
        <router-link :to="'/cs/'+item.id">
            {{item.category.substr(0,1)}}
        </router-link>
        <div>
            {{item.category}}
            <h3>{{item.id}}</h3>
        </div>
    </div>
    <div style="width: 200px;height: 200px;">
        <div :style="{background: getColor()}">
            123
        </div>
    </div>

</div>
</template>

<script>
    import {getColor} from "@/utils/randomcolor";
    import {mapState} from 'vuex'
    export default {
        name: "",
        computed:{
            ...mapState(["data"])
        },
        mounted() {
            console.log(this.data.category)
        },
        methods:{
            getColor
        }

    }
</script>

<style>

</style>
